import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);


import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import VitePluginWebSocket from './vitejs-plugins/websocket/index';

// https://vitejs.dev/config/
export default defineConfig({
    root: path.resolve(__dirname, "./multi-pages/"),
    publicDir: path.resolve(__dirname, "./public/"),
    resolve: {
        alias: {
            "@src": path.resolve(__dirname, "./src"),
            "@libs": path.resolve(__dirname, "./libs"),
            "ol": path.resolve(__dirname, "./libs/ol-9.2.0/")
        }
    },

    plugins: [
        vue(),
        vueJsx(),
        VitePluginWebSocket({ websocketRootFile: path.resolve(__dirname, "./server/ws/ws.test.ts") })
    ],
})
